package com.springboot.service.impl;

import com.springboot.mapper.BVirtualWalletMapper;
import com.springboot.model.bo.BVirtualWalletBO;
import com.springboot.model.po.BVirtualWalletPO;
import com.springboot.service.BVirtualWalletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BVirtualWalletServiceImpl implements BVirtualWalletService {
    @Autowired
    private BVirtualWalletMapper bVirtualWalletMapper;


    @Override
    public BVirtualWalletBO getVirtualWalletByBusinessId(Integer businessId) {
    	BVirtualWalletPO bpo = bVirtualWalletMapper.getVirtualWalletByBusinessId(businessId);
    	if(bpo == null)
    		return null;
    	BVirtualWalletBO bbo = new BVirtualWalletBO();
    	bbo.setBalance(bpo.getBalance());
    	bbo.setBusinessId(bpo.getBusinessId());
    	bbo.setWalletId(bpo.getWalletId());
    	return bbo;
    }
}

